<?php
/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * date: 2021-02-25 18:01:48
 * @LastEditors: Sam
 * @LastEditTime: 2021-03-23 18:48:29
 */
namespace app\__MODULE__\model;
use think\Model;


class Answer extends Model {
    
 
    /**
     * 数据表主键
     * @var string
     */

    protected $pk = 'id';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = true;
    
     /**
     * 模型名称
     * @var string
     */
    protected $name = 'answer';


    public function question(){
        return $this->belongsTo('question','question_id')->bind(['question'=>'title']);
    }

    public function user(){
        return $this->belongsTo(User::class,'uid')->bind(['user_name'=>'name','mobile','nickname']);
    }

    
  
}

